/*
Abstract:
  Serializing functionality declaration

Last changed:
  $Id: outputter.h 69 2009-07-20 21:46:54Z vitamin.caig $

Author:
  (C) Vitamin/CAIG/2001

  This file is the part of Textator project
*/
#ifndef __OUTPUTTER_H_DEFINED__
#define __OUTPUTTER_H_DEFINED__

#include <structures.h>

#include <memory>

namespace IO
{
  class TargetStream;
}

namespace Output
{
  class Outputter
  {
  public:
    typedef std::auto_ptr<Outputter> Ptr;

    virtual ~Outputter()
    {
    }

    virtual void Process(const EntriesMap& input, IO::TargetStream& stream) const = 0;
    virtual void Process(const StringMap& input, IO::TargetStream& stream) const = 0;
  };

  Outputter::Ptr CreateTextOutputter();

  struct AssemblerParameters
  {
    std::size_t Width;
    std::size_t Tab;
    String DefB;
    String Equ;
    bool Inline;
    String Macro;
    String EndMacro;
  };

  Outputter::Ptr CreateAssemblerOutputter(const AssemblerParameters& params);

  struct CPPParameters
  {
    std::size_t Width;
    std::size_t Tab;
    bool Inline;
    String SymbolType;
    String MemoryType;
  };
  Outputter::Ptr CreateCPPOutputter(const CPPParameters& params);
}

#endif //__OUTPUTTER_H_DEFINED__
